package project2.ui.game.operate;

import project2.ui.game.GamePlayingPanel;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;

public class MyPlaneMove extends MouseMotionAdapter {

    private final GamePlayingPanel panel;

    public MyPlaneMove(GamePlayingPanel panel) {
        this.panel = panel;
    }

    @Override
    public void mouseMoved(MouseEvent e) {
        if (panel.myPlane != null && panel.myPlane.isAlive()) {
            panel.myPlane.mouseMoved(e);// 改变位置
            panel.repaint();// 重绘
        }
    }

}
